import request from '@/utils/request'

// 查询设备电池列表
export function listDeviceBattery(query) {
  return request({
    url: '/device/deviceBattery/list',
    method: 'get',
    params: query
  })
}

// 查询设备电池详细
export function getDeviceBattery(id) {
  return request({
    url: '/device/deviceBattery/' + id,
    method: 'get'
  })
}

// 新增设备电池
export function addDeviceBattery(data) {
  return request({
    url: '/device/deviceBattery',
    method: 'post',
    data: data
  })
}

// 修改设备电池
export function updateDeviceBattery(data) {
  return request({
    url: '/device/deviceBattery',
    method: 'put',
    data: data
  })
}

// 删除设备电池
export function delDeviceBattery(id) {
  return request({
    url: '/device/deviceBattery/' + id,
    method: 'delete'
  })
}


// 更新电压数据
export function getBatteryVoltage(deviceId , id) {
  return request({
    url: `/device/deviceBattery/getBatteryVoltage/${deviceId}/?id=`+id,
    method: 'get'
  })
}

// 更新温度数据
export function getBatteryTemperature(deviceId , id) {
  return request({
    url: `/device/deviceBattery/getBatteryVoltage/${deviceId}/?id=`+id,
    method: 'get'
  })
}